import React from 'react';
import ReactDOM from 'react-dom';
import Child from './components/child'
import MyContext from './util'

class App extends React.Component {
  state = {
    q: 1,
    w: 2
  }
  setQ = (n) => {
    this.setState({
      q: n
    })
  }
  render() {
    return <MyContext.Provider value={{ state: this.state, setQ: this.setQ }}>
      <div className=''>
        <h1>父组件</h1>
        <Child />
      </div>;
    </MyContext.Provider>


  }
}

ReactDOM.render(<App />, document.getElementById('root'))